Hosting a Dedicated Server
A dedicated server is a method of hosting an Unturned server that does not require the host to be an active player in the game. It allows people to set up servers remotely, such as on a rented Windows or Linux VPS. A dedicated server can also be run on a home PC. In this case, the host can play on the server, or just leave it running in the background to allow others to play on it even if he is not in the server. A dedicated server also allows for versatility in setting different functions, such as increasing the maximum player limit beyond 12. The -sv parameter needs to be at the end of the parameters. A dedicated server still needs an opened port for players to connect. Follow the port-forwarding instructions at Hosting a Listen Server. Important #2: Dedicated servers are currently unable to provide administrative commands to the server owner (kick/ban). However, this functionality is planned and should be available when the Steam API integration is finished. Keep your eyes on the Steam Announcements in order to stay updated with this feature. Windows Setup (2.2.5) # From the Steam window, right-click the Unturned game in your Library and select "Properties". # Click in the "Local Files" tab. # Click "Browse Local Files...". # In the explorer window, right-click the "Unturned.exe", hover the mouse over "Send To", and click on "Desktop (create shortcut)". # Right-click on the newly created shortcut and select "Properties". The "Target:" field should contain the path to Unturned.exe and should look something like this: #: "C:\Program Files (x86)\Steam\steamapps\common\Unturned\Unturned.exe" # In order for the server to run, you need to add add options to the end of the field. For example, if you wanted the server to be PvE, you would add the ''-pve'' option to the end of the field. A complete list of options is at the bottom of the page. # An example of a finished "Target" field: #: "C:\Program Files (x86)\Steam\steamapps\common\Unturned\Unturned.exe" -port:25444 -players:20 -nographics -pei -gold -nosync -pve -sv Note: for me only this arrangement worked in the target-field 7 Starter 32bit: (with quotes "...") : "C:\Program Files (x86)\Steam\steamapps\common\Unturned\Unturned.exe" -port:25444 -players:20 -nographics -pei -normal -nosync -pve -sv 8. To finish, simply apply changes to the shortcut and double-click it to run it. The game should run and then immediately go to a gray screen. This screen means the server is running fine. If your screen doesn't go gray and the server does not work, make sure you put the ''-sv'' option at the end of your options, otherwise the server may not work. Windows Setup (3.0) # Right-click the "Unturned.exe", hover the mouse over "Send To", and click on "Desktop (create shortcut)". # Right-click on the shortcut and select "Properties". The "Target:" field should contain the path to Unturned.exe and should look something like this: #: "C:\Program Files (x86)\Steam\steamapps\common\Unturned\Unturned.exe" # Now, at the end of the string of text, insert this string of text: #: -nographics -batchmode +secureserver/... ...' is whatever you want to name your server'' - An example of a finished "Target" field: "C:\Program Files (x86)\Steam\steamapps\common\Unturned\Unturned.exe" -nographics -batchmode +secureserver/My server Finally, run the server. A black console screen should appear, with no text. Configuring your Server Type shutdown in the console. Go back to the Steam 'Unturned folder'. Now click on Servers, then you should see a folder, with the name of your server. Click on that folder. Click on the subfolder Server. There should be 5 .dat documents, labeled Adminlist, Blacklist, Commands, Playerlist and Whitelist. Use the Commands file if you want to run list of commands that will run each time the server starts. Use a separate line for each command. Basic Commands Note: You do not need to capitalize the commands. * Help - This will give a list of usable commands * Name - Gives a name to your server * Port - Give an alternate port number to your server if the default is already taken * Password - Sets a password, that will be needed to join your server. * Maxplayers - Sets the maximum number of players that can join the server at once * Map - Ability to select the map or level to run your server on * Mode - Select the difficulty of your server * Admins - Posts admin list on start up * Permits - Posts whitelist on startup * Players - Posts playerlist on startup * Timeout - Sets max ping (recommended 400-600 for lag spikes and long distance connection) * Bindip - Binds your '''external ip to your server (if static) * Perspective - Restricts perpestive to thirdperson, firstperson or both. * Owner - Allows full server setup without console. Connecting to the server You should now be able to connect to your own server by running the game through Steam. To do this, click Play '''> '''Connect, and in the IP field, type "localhost", then click "Connect" to join your own server. If you fail to connect to your own server, try installing steamVR (found under tools in Steam). Note: Other players will not use "localhost", only you will. Other players will use your EXTERNAL IP to connect to your server. Find your external IP by visiting http://www.whatismyip.com/ Port forwarding !!! THIS CAN BE THE MOST CONFUSING STEP, SO READ CAREFULLY !!! * Make sure to port forward the default port on unturned 3.0 is 27015. You will also need to port forward 27016 and 27017 (yes all three at the same time) for the server to work. If you want to use your own port number you can set that in the config files when you are typing in the commands in the commands.dat. Let's say you use the port 12345. You will also need to port forward that plus ports 12346 and 12347. In short you need to port forward whatever port you're using and the next two ports up. Mac OS X Setup # Watch This Video https://www.youtube.com/watch?v=yFQn3rHUuxU Or Follow these steps # From the Steam window, right-click the Unturned game in your Library and select "Properties". # Click in the "Local Files" tab. # Click "Browse Local Files...". # (Optional Go Back to Common and copy the unturned folder and paste it in common and name it Unturned Server ) # In the finder window right click on Unturned # Select Show Package Contents # Select Contents # Select MacOs # Open up terminal # Then Drag the Unturned Executable Into Terminal # Press Space # Then add In Perimeters (-port:25444 -players:20 -nographics -pei -normal -nosync -pve -sv) # Then Press Enter With unturned 3.0, the procedure is exactly the same, but after the parameters, you need to add: +secureserver/servername Replace "secureserver" with "lanserver" if you want a LAN server instead. Replace "servername" with what you want to name your server. Linux Setup Note: Unfortunately, Patch 2.2.2 broke the dedicated server for Linux. Output before crash is: fixme:d3d:resource_check_usage Unhandled usage flags 0x8. fixme:ver:GetCurrentPackageId (0x32f1b8 (nil)): stub fixme:win:UnregisterDeviceNotification (handle=0xcafeaffe), STUB! The WINE compatibility layer can be used to run an Unturned dedicated server on Linux-based operating systems such as Ubuntu. The following is the procedure for Ubuntu 14.04 and can be adapted to any similar OS. You will need to startx in its own shell, using tmux or screen or equivalent, so that you can also run Unturned.exe. File installation A short-term testing method is to use WinSCP or a similar SFTP software to transfer the entire Unturned folder over to the Linux server. The folder is likely located in C:\Program Files (x86)\Steam\SteamApps\common\. The problem with this option is that you must update the server files with WinSCP every time an update is released. A better option is to use SteamCMD, which is a light-weight Linux Steam client that downloads and updates the required Unturned files. # Download steamcmd to the server #: wget http://media.steampowered.com/installer/steamcmd.zip # Unzip it: #: unzip steamcmd.zip # Start SteamCMD: #: wine steamcmd.exe # Login to a Steam account: #: login username password # Define an installation directory: #: force_install_dir Z:/home/your/unix/folder # Download the game to the dedicated server. "app_update 304930" also updates the files of the force_install_dir you pointed at. #: app_update 304930 Running the server # Starting from root, add a user: #: adduser unt #: adduser unt sudo # Log in using the new user: #: su unt # Install wine and xinit: #: sudo apt-get install wine xinit # Configure X to allow Anybody to start it: #: sudo dpkg-reconfigure x11-common # Start X (headless style): #: tmux #: startx # Move to a different shell in tmux: #: CTRL+B, C # Tell WINE to use the headless X session: #: export DISPLAY=:0.0 # Start the Unturned server: #: wine Unturned.exe -nographics -pei -normal -nosync -pve -players:16 -sv Command Line Options Order of commands does not matter. *Map: **-arena **-pei *Gamemode: **-bambi **-normal **-hardcore **-gold *Sync Setting: **-sync **-nosync *PVP/PVE Setting: **-pvp **-pve *Misc: **-pass:PASSWORD **-port:NUMBER **-players:MAX **-nographics (This command is needed to not see the welcome screen. Instead you see a black screen with no GUI.) **-sv (needs to be at the end of the parameters) ** -batchmode (prevents the game from launching a GUI, and makes it run as a background process. Greatly reduces CPU usage) Optional Server Improvements *(Free) Turn your IP address into a DNS: **Utilizing a website such as http://www.noip.com/ will allow you to create an easy-to-remember text-based IP address, such as "myserver.zapto.net". Players will use this name to connect to your server instead of the numbered alternative, such as "74.12.127.76". **#Register for a new account (free) **#Aftering signing in, select "Add a Host" **#Most of the fields are already done for you. You only need to give the host a name in the "Hostname" field, such as "unturned", "myserver", etc. You also have the option of choosing the domain name from the drop-down menu immediately to the right of the hostname. In the example to the right, my hostname will become "unturned.ddns.net". **#Once you click "Add Host", your IP address now matches the Hostname. Players can now use your hostname to connect to your server instead of your numbered IP address. **#'Optional but recommended:' Download the No-IP client in the sidebar menu on the left (download link here ). The client will run in your taskbar and automatically update your hostname to match your IP address if it changes in the future. If you skip this step, you will need to change your IP address manually with "Manage Hosts" on the noip.com website. * (Free) IP to DNS via Duckdns (extra option for DNS): ** The steps are listed on https://duckdns.org and are similar to steps for no-ip. It's just another option that exists to achieve the same goal. They have a clear FAQ and Install guide for people new to it. Category:Tutorials